package mailclient.client;

enum CommandType {
    
    Exit,
    Help;

    @Override
    public String toString() {
        switch (this) {
            case Exit:
                return "exit";
            case Help:
                return "help";
            default:
                return "undefined";
        }
    }

    public static CommandType parse(String cmd) {
        for (CommandType c : CommandType.values()) {
            if (cmd.equalsIgnoreCase(c.toString())) {
                return c;
            }
        }
        return null;
    }
}
